package com.example.controller;

import com.example.models.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Date 2021/6/26
 * @Created by Jonathan
 */
@Slf4j
@RestController
public class GetRequestNeedBodyController {

    @GetMapping("/get/body/{uid}")
    public Object test(@RequestBody Person person, @PathVariable String uid) {
        log.info("person:{}", person);
        log.info("uid:{}", uid);
        return person;
    }

    @GetMapping("/test/test")
    public String hello(){
        log.info("hello world");
        return "hello world";
    }
}
